#ifndef __LOG_BASE_OUT_H__
#define __LOG_BASE_OUT_H__
#include <typecomm.h>

enum logLevelEnum
{
    logLevelFatal = 0,
    logLevelError,
    logLevelWarn,
    logLevelInform,
    logLevelDebug,
    logLevelTrace,
};

#if DEVICE_PLATFORM_CONFIGURE != DEVICE_PLATFORM_C51_MCU
// int clogCommon(int lev, const char *lfile, int lline, const char *fmt, ...);
int __attribute__((format(printf, 4, 5))) clogCommon(int lev, const char *lfile, int lline, const char *fmt, ...);
#define logfatalc(fmt, ...) clogCommon(logLevelFatal, __FILE__, __LINE__, " " fmt, ##__VA_ARGS__)
#define logerrorc(fmt, ...) clogCommon(logLevelError, __FILE__, __LINE__, " " fmt, ##__VA_ARGS__)
#define logwarnc(fmt, ...) clogCommon(logLevelWarn, __FILE__, __LINE__, " " fmt, ##__VA_ARGS__)
#define loginfoc(fmt, ...) clogCommon(logLevelInform, __FILE__, __LINE__, " " fmt, ##__VA_ARGS__)
#define logdebugc(fmt, ...) clogCommon(logLevelDebug, __FILE__, __LINE__, " " fmt, ##__VA_ARGS__)
#define logtracec(fmt, ...) clogCommon(logLevelTrace, __FILE__, __LINE__, " " fmt, ##__VA_ARGS__)
#else
void logSndByte(char sndval);
void logSndStr(const char *sndStr, int sndlen);
void logfatalc(const char *fmt, ...);
void logerrorc(const char *fmt, ...);
void logwarnc(const char *fmt, ...);
void loginfoc(const char *fmt, ...);
void logdebugc(const char *fmt, ...);
void logtracec(const char *fmt, ...);
#endif
void logHexBufStr(const char *expStr, const char *hexptr, int hexsize);

#endif
